morning-challenge

##challenge

Use the switch case statement to write a script that outputs the number of days in a month based on the input month and year.

Hint There are four cases:

  • If the month is 1, 3,5, 7, 8, 10, or 12, the number of days in a month is 31.
  • If the month is 4, 6, 9, or 11, the number of days in that month is 30.
  • If the month is 2, and the year is not the leap year, the number of days is 28. If the year is the leap year, the number of days is 29.
  • If the input month is not in the range, the script jumps the default branch and sets the dayCount variable to -1 that indicates the invalid month.